
#include "PowerSupply.h"
#include "PowerAdapter.h"
#include "DirectGenerator.h"
#include "AlternatingGenerator.h"
#include <iostream>

int main(int argc, char* argv[])
{
  PowerSupply* power_supply = new PowerAdapter(new AlternatingGenerator());
  power_supply->Input(new DirectGenerator()); // 无论怎么设置输入电流的类型或电压，总是能得到相同的输出
  Current* current = power_supply->Output();
  std::cout << "电压：" << current->get_volt() << std::endl;
  std::cout << "电流类型：" << current->get_type() << std::endl;

  delete power_supply;
  delete current;
  return 0;
}
